<template>
  <page-body>
    <view class="page ">
      <view class="flex benben-position-layout flex flex-wrap align-center Lockers_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub Lockers_fd0_0'>
          <view class='flex flex-wrap align-center Lockers_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
            data-url="1">
          </view>
          <view class='flex flex-wrap align-stretch justify-center'>
            <text class='Lockers_fd0_0_c1_c0'>储物柜</text>
          </view>
          <view class='flex flex-wrap align-center justify-end Lockers_fd0_0_c0'>
            <!-- <image class='Lockers_fd0_0_c2_c0' mode="aspectFit" :src='STATIC_URL+"180.png"'></image> -->
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction align-stretch benben-flex-layout ">
        <view class='flex flex-wrap align-center Lockers_fd1_0'>
          <text>总存储</text>
          <text class='Lockers_fd1_0_c1'>{{info.user_num}}/{{info.total_num}}</text>
        </view>
        <view class='flex flex-wrap align-center '>
          <view class=' flex flex-wrap align-center Lockers_fd1_1_c0' v-for="(item,index) in dataList" :key="index">
            <view class='flex flex-direction align-center self-center justify-center Lockers_fd1_1_c0_c0'>
              <text v-if="item.list.length">第{{index+1}}个储物柜 <text
                  v-if="item.list.length">{{item.existingspace}}/{{item.storagespace}}</text></text>
              <text v-if="item.list.length==0">新增储物柜</text>
              <image @tap.stop="handleJumpDiy" data-type="navigateTo"
                :data-url="`/pages/homePage/purchasestoragecabinets/purchasestoragecabinets`" v-if="item.list.length==0"
                class='Lockers_fd1_1_c0_c0_c1' mode="aspectFit" :src='STATIC_URL+"179.png"'></image>
              <view v-for="(itemC,indexC) in item.list" :key="itemC" @tap.stop="handleJumpDiy" data-type="navigateTo"
                :data-url="`/pages/tabBar/Lockers/detail?aid=${item.aid}`">
                <view class='flex flex-wrap align-center Lockers_fd1_1_c0_c0_c2' v-if="!itemC"></view>
                <view class='flex flex-wrap align-center Lockers_fd1_1_c0_c0_c2s' v-if="itemC"></view>
              </view>
            </view>
          </view>
        </view>
        <!-- <view class='flex flex-direction align-stretch'>
      <view class='flex flex-wrap align-stretch Lockers_fd1_2_c0'>
        <view class='flex flex-wrap align-center Lockers_fd1_2_c0_c0'>
          <image class='Lockers_fd1_2_c0_c0_c0' mode="aspectFill" :src='STATIC_URL+"137.png"'></image>
          <view class='flex flex-direction align-stretch Lockers_fd1_2_c0_c0_c1'>
            <text class='Lockers_fd1_2_c0_c0_c1_c0'>这是一段标题文字这是一段标题文
              字这是一段这是一段标题文这是一段标题文字这是一段标题文字这是一段这是一段标题文字</text>
            <view class='flex flex-wrap align-center justify-between flex-sub Lockers_fd1_2_c0_c0_c1_c1'>
              <text class='Lockers_fd1_2_c0_c0_c1_c1_c0'>仅自己可见</text>
              <text class='Lockers_fd1_2_c0_c0_c1_c1_c1'>可售</text>
            </view>
            <view class='flex flex-wrap align-center'>
              <text class='Lockers_fd1_2_c0_c0_c1_c2_c0'>编辑日期 2024-03-03 15:00</text>
            </view>
          </view>
          <view class='flex flex-wrap align-center justify-between flex-sub Lockers_fd1_2_c0_c0_c2'>
            <view class='flex flex-wrap align-center'>
              <image class='Lockers_fd1_2_c0_c0_c2_c0_c0' mode="aspectFit" :src='STATIC_URL+"171.png"'></image>
              <text>126</text>
            </view>
            <view class='flex flex-wrap align-center'>
              <image class='Lockers_fd1_2_c0_c0_c2_c0_c0' mode="aspectFit" :src='STATIC_URL+"172.png"'></image>
              <text>126</text>
            </view>
            <view class='flex flex-wrap align-center'>
              <view class='flex flex-wrap align-center Lockers_fd1_2_c0_c0_c2_c2_c0'>
                <image class='Lockers_fd1_2_c0_c0_c2_c0_c0' mode="aspectFit" :src='STATIC_URL+"182.png"'></image>
                <view class='flex flex-wrap align-center Lockers_fd1_2_c0_c0_c2_c2_c0_c1'>
                </view>
              </view>
              <text>126</text>
            </view>
            <view class='flex flex-wrap align-center'>
              <image class='Lockers_fd1_2_c0_c0_c2_c0_c0' mode="aspectFit" :src='STATIC_URL+"183.png"'></image>
              <text>126</text>
            </view>
          </view>
        </view>
        <view class='flex flex-wrap align-center justify-end flex-sub'>
          <button class='Lockers_fd1_2_c0_c1_c0' @tap.stop="handleJumpDiy" data-type="navigateTo"
            :data-url="`/pages/homePage/publishupdates/publishupdates`">编辑</button>
        </view>
      </view>
      <view class='flex flex-direction flex-wrap align-center Lockers_fd1_2_c0'>
        <image class='Lockers_fd1_2_c1_c0' mode="aspectFit" :src='STATIC_URL+"181.png"'></image>
        <text class='Lockers_fd1_2_c1_c1'>存储新内容</text>
        <text class='Lockers_fd1_2_c1_c2'>储物柜到期时间 2024-06-03 15:00</text>
      </view>
    </view> -->
      </view>

      <!---flex布局flex布局结束-->
      <fu-empty-ui v-if="dataList.length==0"></fu-empty-ui>

    </view>
  </page-body>
</template>
<script>
  import {
    validate
  } from '@/common/utils/validate.js'
  // 11111111111111111111
  import {
    TUILogin
  } from "@tencentcloud/tui-core";
  import {
    SYSTEM_CONFIG,
    SDKAppID,
    secretKey
  } from "@/common/config.js";
  import {
    TUIChatKit,
    genTestUserSig
  } from "@/TUIKit";
  import {
    vueVersion
  } from "@/TUIKit/adapter-vue";
  // 22222222222222222222222222
  export default {
    components: {},


    data() {
      return {
        "dataList": [],
        info: ''
      };
    },
    computed: {
      isLogin() {
        return this.$store.state.token == '' ? false : true;
      },
      userInfo: {
        get() {
          return this.$store.state.userInfo
        },
        set() {
          this.$store.commit('updateUserInfo', value)
        },
      }
    },
    watch: {},
    onLoad(options) {

    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {
      this.getjc698cec19d9caFunc()
      if (this.isLogin) {
        const userID = this.userInfo ? this.userInfo.id.toString() : '';
        let config = {
          userID: userID, //User ID
          SDKAppID: SDKAppID, // Your SDKAppID
          secretKey: secretKey, // Your secretKey
        }
        const userSig = genTestUserSig(config).userSig;
        TUILogin.login({
          SDKAppID: config.SDKAppID,
          userID: config.userID,
          userSig: userSig,
          // 如果您需要发送图片、语音、视频、文件等富媒体消息，请设置为 true
          useUploadPlugin: true,
          useProfanityFilterPlugin: false,
          framework: `vue${vueVersion}` // 当前开发使用框架 vue2 / vue3
        }).then(() => {
          let nums = uni.$TIM.getTotalUnreadMessageCount();
          if (nums) {
            uni.setTabBarBadge({
              index: 2,
              text: nums.toString()
            })
          }

        })
      } else {
        uni.removeTabBarBadge({
          index: 2
        })
      }
    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      //查询储物内容
      async getjc698cec19d9caFunc() {
        //请求方法
        //数据验证

        let datadataList = await this.$api.get(global.apiUrls.post6698b81047656, {});

        if (datadataList.data.code != 1) {
          this.$message.info(datadataList.data.msg);
          return
        }
        let infodataList = datadataList.data;
        this.dataList = infodataList.data.list
        this.info = datadataList.data.data

      }
    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: url(image-path('178.png')) no-repeat;
    background-size: 100% auto;
    padding-bottom: 132rpx;
  }

  .Lockers_flex_0 {
    background: url(image-path('178.png')) no-repeat;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .Lockers_fd0_0_c2_c0 {
    width: 40rpx;
    height: 40rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .Lockers_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 700;
    color: #333333;
    line-height: 50rpx;
  }

  .Lockers_fd0_0_c0 {
    width: 120rpx;
  }

  .Lockers_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .Lockers_fd1_2_c1_c2 {
    margin: 40rpx 0rpx 0rpx 0rpx;
  }

  .Lockers_fd1_2_c1_c1 {
    margin: 16rpx 0rpx 0rpx 0rpx;
    font-size: 24rpx;
    color: rgba(153, 153, 153, 1);
  }

  .Lockers_fd1_2_c1_c0 {
    width: 80rpx;
    height: 80rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
    margin: 80rpx 0rpx 0rpx 0rpx;
  }

  .Lockers_fd1_2_c0_c1_c0 {
    background: linear-gradient(180deg, #176BE8 0%, #5A5CFC 100%);
    border-radius: 40rpx 40rpx 40rpx 40rpx;
    width: 144rpx;
    line-height: 56rpx;
    font-size: 28rpx;
    color: #fff;
    height: 56rpx;
    margin: 24rpx 0rpx 0rpx 0rpx;
  }

  .Lockers_fd1_2_c0_c0_c2_c2_c0_c1 {
    border: 2px solid #FFFFFF;
    background: #FF4646;
    width: 16rpx;
    height: 16rpx;
    position: absolute;
    right: 20rpx;
    top: 0rpx;
  }

  .Lockers_fd1_2_c0_c0_c2_c2_c0 {
    position: relative;
  }

  .Lockers_fd1_2_c0_c0_c2_c0_c0 {
    width: 40rpx;
    height: 40rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
    margin: 0rpx 24rpx 0rpx 0rpx;
  }

  .Lockers_fd1_2_c0_c0_c2 {
    margin: 32rpx 0rpx 0rpx 0rpx;
  }

  .Lockers_fd1_2_c0_c0_c1_c2_c0 {
    font-size: 24rpx;
    color: var(--benbenFontColor2);
  }

  .Lockers_fd1_2_c0_c0_c1_c1_c1 {
    color: var(--benbenFontColor5);
  }

  .Lockers_fd1_2_c0_c0_c1_c1_c0 {
    color: rgba(90, 92, 252, 1);
    font-size: 24rpx;
  }

  .Lockers_fd1_2_c0_c0_c1_c1 {
    margin: 16rpx 0rpx 16rpx 0rpx;
  }

  .Lockers_fd1_2_c0_c0_c1_c0 {
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
  }

  .Lockers_fd1_2_c0_c0_c1 {
    width: 430rpx;
  }

  .Lockers_fd1_2_c0_c0_c0 {
    width: 184rpx;
    height: 184rpx;
    border-radius: 16rpx;
    margin: 0rpx 24rpx 0rpx 0rpx;
  }

  .Lockers_fd1_2_c0_c0 {
    border-bottom: 1px solid #eee;
    padding: 0rpx 0rpx 24rpx 0rpx;
  }

  .Lockers_fd1_2_c0 {
    background: var(--benbenbgColor1);
    margin: 24rpx auto 0rpx auto;
    padding: 24rpx;
    border-radius: 16rpx;
    background-size: 100% auto;
    width: 702rpx;
  }

  .Lockers_fd1_1_c0_c0_c2 {
    background: url(image-path('177.png')) no-repeat;
    background-size: 100% 100%;
    width: 277rpx;
    height: 50rpx;
    margin: 16rpx 0rpx 0rpx 0rpx;
  }

  .Lockers_fd1_1_c0_c0_c2s {
    background: url(image-path('204.png')) no-repeat;
    background-size: 100% 100%;
    width: 277rpx;
    height: 50rpx;
    margin: 16rpx 0rpx 0rpx 0rpx;
  }

  .Lockers_fd1_1_c0_c0_c1 {
    width: 120rpx;
    height: 83rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
    margin: 32rpx 0rpx 24rpx 0rpx;
  }

  .Lockers_fd1_1_c0_c0 {
    background: rgba(255, 255, 255, 1);
    background-size: 100% auto;
    border-radius: 16rpx;
    padding: 16rpx;
    width: 307rpx;
  }

  .Lockers_fd1_1_c0 {
    background: url(image-path('176.png')) no-repeat;
    background-size: 100% 100%;
    padding: 16rpx;
    margin: 16rpx 0rpx 0rpx 24rpx;
  }

  .Lockers_fd1_0_c1 {
    margin: 4rpx 0rpx 0rpx 32rpx;
  }

  .Lockers_fd1_0 {
    background: #D7E6FB;
    border-radius: 16rpx 16rpx 16rpx 16rpx;
    width: 702rpx;
    height: 73rpx;
    margin: 0rpx auto 0rpx auto;
    padding: 0rpx 24rpx 0rpx 24rpx;
    font-size: 24rpx;
    color: rgba(23, 107, 232, 1);
  }
</style>
